
var io = require('socket.io').listen(500);
var clientList = new Array(); 
var indexList = 0;
io.sockets.on('connection', function (socket) {
  clientList[indexList] = socket;
  indexList ++;
  /*$.each(clientList, function(index, value) { 
 		value.emit('news', { hello: indexList });
	});*/
var i = 0;
for (i = 0; i < indexList; i++)
{
	socketClient = clientList[i];
	socketClient.emit('news', { hello: indexList });
}
 // socket.emit('news', { hello: 'world' });
  //socket.on('my other event', function (data) {
    //console.log(data);
  //});
});